<template>
  <div>
    工资：
    <button @click="btnClick">跳转到社保页面传入值：123</button>
    <button @click="btnClick2">跳转到考勤页面传入值：123</button>

    <h3>兄弟组件传值</h3>
    <Sona />
    <hr>
    <Sonb />
  </div>
</template>
<script>
import Sona from './components/sona.vue'
import Sonb from './components/sonb.vue'
export default {
  components: {
    Sona,
    Sonb
  },
  provide() {
    return {
      abc: '我是领导，明天放假',
      fn: this.fn
    }
  },
  methods: {
    fn(str) {
      console.log('后代组件返回过来的信息', str)
    },
    btnClick() {
      // this.$router.push('/social')
      this.$router.push({
        name: 'Social',
        query: {
          num: 123
        }
      })
    },
    btnClick2() {
      this.$router.push({
        name: 'Attendances',
        params: {
          num: 123
        }
      })
    }
  }
}
</script>
<style></style>
